<template>
	<view>
		<!-- #ifndef H5 -->
		<!-- <fui-nav-bar></fui-nav-bar> -->
		<!-- #endif -->	
		<view style="width: 100%;height: 55rpx;background-color: #fff;">
			<view @click="cli_list(index)" style="width: 25%;font-size: 30rpx;text-align: center;float: left;"
			 :style="type==index?'font-size:32rpx;font-weight:700':''"
			 v-for="(item,index) in tabList">
				<view style="width: 100%;">
					{{item}}
				</view>		
				<view v-if="index==type" style="height:6rpx;width: 40rpx;background: #eadec6;margin: 0 auto;margin-top: 6rpx;">
				</view>	
			</view>
		</view>	
		
		<view class="myorder">
			
		</view>	
		<noData :noDataShow="noDataShow" hintText="暂无订单"></noData>
	</view>
</template>

<script>
	import noData from '@/components/noData.vue'
	export default {
		components: {
			noData
		},
		data() {
			return {
				orderList: [
					{ icon: '/static/my/ic_shop_mall_save.png', label: '全部订单', url: '/pages/my/mywallet' },
					{ icon: '/static/my/ic_confirm_receipt.png', label: '待付款', url: '/pages/share/share_msg' },
					{ icon: '/static/my/ic_shop_card_cabinet.png', label: '待发货', url: '' },
					{ icon: '/static/my/ic_shop_mall_copyright_product.png', label: '待收货', url: '/pages/my/wenti' },
				],
				navList: [
					{ icon: '/static/a1.png', label: '我的钱包', url: '/pages/my/mywallet' },
					{ icon: '/static/a2.png', label: '邀请好友', url: '/pages/share/share_msg' },
					{ icon: '/static/a3.png', label: '收货地址', url: '' },
					{ icon: '/static/a4.png', label: '帮助中心', url: '/pages/my/wenti' },
					{ icon: '/static/a5.png', label: '支付宝绑定', url: '' },
					{ icon: '/static/a6.png', label: '身份认证', url: '' },
					{ icon: '/static/a7.png', label: '检查更新', url: '' },
					{ icon: '/static/a8.png', label: '我的积分', url: '/pages/my/my-score' },
					{ icon: '/static/a9.png', label: '保险箱', url: '' }
				],
				tabList:["全部","待付款","待发货","待收货"],
				userinfo:null,
				
				type:0,
				
				page: 1,
				total: 0,
				list: [],
			};
		},
		onShow() {
		
			
			this.get_userinfo();
		},
		computed: {
			noDataShow() {
				return !this.list.length
			}
		},
		methods: {
			cli_list(index){
				this.type = index
			},
			share_dea(){
				uni.navigateTo({ url: "/pages/share/share_list"});
			},
			get_userinfo(){
				let that = this;
				uni.showLoading({ title: '正在加载', mask: true });
				uni.hideLoading();
				that.$api.request('/api/user/get_info', {},uni.getStorageSync('token'), function(res) {
								uni.hideLoading()
								if (res.code === 1) {
									that.userinfo = res.data
								} else {
									uni.showToast({
										title: res.msg,
										icon: 'none'
									})
								}
				});
				
			},
			// 导航点击处理
			navClickHandle(item) {
				if (item.url) {
					uni.navigateTo({ url: item.url });
				}
			},

			// 跳转设置
			jumpSetting() {
				uni.navigateTo({
					url: '/pages/settings/settings'
				});
			},

			// 跳转分享页面
			jumpShare() {
				uni.navigateTo({
					url: '/pages/share/share'
				});
			}
		}
	};
</script>

<style lang="less">
	page {
		background: #fff;
	}
	.myorder{
		width: 94%;
		margin-left: 3%;
	}

</style>
